#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
#include<string.h>
void reserve(char* left,char* right)
{
	char tmp = 0;
    assert(left != NULL);
	assert(right != NULL);
	while(left < right)
	{
	    tmp = *left;
		*left = *right;
		*right = tmp;
		left++;
		right--;
	}
}
void left_move(char arr[],int k)
{
    int len = strlen(arr);
	k %= len;                       //abcdef  k = 2
 	reserve(arr,arr+k-1);           //bacdef
	reserve(arr+k,arr+len-1);       //bafedc
	reserve(arr,arr+len-1);         //cdefab
}
int main()
{
    char arr[] = "abcdef";
	int k = 0;
	scanf("%d",&k);
	left_move(arr,k);
	printf("%s\n",arr);
	return 0;
}


